﻿using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using PortaCapena.OdooJsonRpcClient.Attributes;
using PortaCapena.OdooJsonRpcClient.Converters;
using PortaCapena.OdooJsonRpcClient.Models;
using System;
using System.ComponentModel;
using System.Runtime.Serialization;

namespace OdooRpcClient.Model.Sale
{
    [OdooTableName("sale.order")]
    [JsonConverter(typeof(OdooModelConverter))]
    public class SaleOrderOdooModel : IOdooModel
    {

        /// <summary>
        /// Name
        /// Char
        /// required
        /// <summary>
        [JsonProperty("name")]
        [Description("Name")]
        public string Name { get; set; }

        /// <summary>
        /// Origin
        /// Char
        /// Reference of the document that generated this sales order request.
        /// <summary>
        [JsonProperty("origin")]
        [Description("Origin")]
        public string Origin { get; set; }

        /// <summary>
        /// ClientOrderRef
        /// Char
        /// <summary>
        [JsonProperty("client_order_ref")]
        [Description("ClientOrderRef")]
        public string ClientOrderRef { get; set; }

        /// <summary>
        /// Reference
        /// Char
        /// The payment communication of this sale order.
        /// <summary>
        [JsonProperty("reference")]
        [Description("Reference")]
        public string Reference { get; set; }

        /// <summary>
        /// State
        /// Selection
        /// <summary>
        [JsonProperty("state")]
        [Description("State")]
        public StatusSaleOrderOdooEnum? State { get; set; }

        /// <summary>
        /// DateOrder
        /// Datetime
        /// Creation date of draft/sent orders,
        /// Confirmation date of confirmed orders.
        /// required
        /// <summary>
        [JsonProperty("date_order")]
            [Description("DateOrder")]
        public DateTime DateOrder { get; set; }

        /// <summary>
        /// ValidityDate
        /// Date
        /// <summary>
        [JsonProperty("validity_date")]
        [Description("ValidityDate")]
        public DateTime? ValidityDate { get; set; }

        /// <summary>
        /// IsExpired
        /// Boolean
        /// <summary>
        [JsonProperty("is_expired")]
        [Description("IsExpired")]
        public bool? IsExpired { get; set; }

        /// <summary>
        /// RequireSignature
        /// Boolean
        /// Request a online signature to the customer in order to confirm orders automatically.
        /// <summary>
        [JsonProperty("require_signature")]
        [Description("RequireSignature")]
        public bool? RequireSignature { get; set; }

        /// <summary>
        /// RequirePayment
        /// Boolean
        /// Request an online payment to the customer in order to confirm orders automatically.
        /// <summary>
        [JsonProperty("require_payment")]
        [Description("RequirePayment")]
        public bool? RequirePayment { get; set; }

        /// <summary>
        /// CreateDate
        /// Datetime
        /// Date on which sales order is created.
        /// <summary>
        [JsonProperty("create_date")]
        [Description("CreateDate")]
        public DateTime? CreateDate { get; set; }

        /// <summary>
        /// UserId
        /// Many2one
        /// res.users
        /// <summary>
        [JsonProperty("user_id")]
        [Description("UserId")]
        public long? UserId { get; set; }

        /// <summary>
        /// PartnerId
        /// Many2one
        /// required
        /// res.partner
        /// <summary>
        [JsonProperty("partner_id")]
        [Description("PartnerId")]
        public long PartnerId { get; set; }

        /// <summary>
        /// PartnerInvoiceId
        /// Many2one
        /// required
        /// res.partner
        /// <summary>
        [JsonProperty("partner_invoice_id")]
        [Description("PartnerInvoiceId")]
        public long PartnerInvoiceId { get; set; }

        /// <summary>
        /// PartnerShippingId
        /// Many2one
        /// required
        /// res.partner
        /// <summary>
        [JsonProperty("partner_shipping_id")]
        [Description("PartnerShippingId")]
        public long PartnerShippingId { get; set; }

        /// <summary>
        /// PricelistId
        /// Many2one
        /// If you change the pricelist, only newly added lines will be affected.
        /// required
        /// product.pricelist
        /// <summary>
        [JsonProperty("pricelist_id")]
        [Description("PricelistId")]
        public long PricelistId { get; set; }

        /// <summary>
        /// CurrencyId
        /// Many2one
        /// res.currency
        /// <summary>
        [JsonProperty("currency_id")]
        [Description("CurrencyId")]
        public long? CurrencyId { get; set; }

        /// <summary>
        /// AnalyticAccountId
        /// Many2one
        /// The analytic account related to a sales order.
        /// account.analytic.account
        /// <summary>
        [JsonProperty("analytic_account_id")]
        [Description("AnalyticAccountId")]
        public long? AnalyticAccountId { get; set; }

        /// <summary>
        /// OrderLine
        /// One2many
        /// sale.order.line
        /// order_id
        /// <summary>
        [JsonProperty("order_line")]
        [Description("OrderLine")]
        public long[] OrderLine { get; set; }

        /// <summary>
        /// InvoiceCount
        /// Integer
        /// <summary>
        [JsonProperty("invoice_count")]
        [Description("InvoiceCount")]
        public int? InvoiceCount { get; set; }

        /// <summary>
        /// InvoiceIds
        /// Many2many
        /// account.move
        /// <summary>
        [JsonProperty("invoice_ids")]
        [Description("InvoiceIds")]
        public long[] InvoiceIds { get; set; }

        /// <summary>
        /// InvoiceStatus
        /// Selection
        /// <summary>
        [JsonProperty("invoice_status")]
        [Description("InvoiceStatus")]
        public InvoiceStatusSaleOrderOdooEnum? InvoiceStatus { get; set; }

        /// <summary>
        /// Note
        /// Text
        /// <summary>
        [JsonProperty("note")]
        [Description("Note")]
        public string Note { get; set; }

        /// <summary>
        /// AmountUntaxed
        /// Monetary
        /// <summary>
        [JsonProperty("amount_untaxed")]
        [Description("AmountUntaxed")]
        public decimal? AmountUntaxed { get; set; }

        /// <summary>
        /// AmountByGroup
        /// Binary
        /// type: [(name, amount, base, formated amount, formated base)]
        /// <summary>
        [JsonProperty("amount_by_group")]
        [Description("AmountByGroup")]
        public string AmountByGroup { get; set; }

        /// <summary>
        /// AmountTax
        /// Monetary
        /// <summary>
        [JsonProperty("amount_tax")]
        [Description("AmountTax")]
        public decimal? AmountTax { get; set; }

        /// <summary>
        /// AmountTotal
        /// Monetary
        /// <summary>
        [JsonProperty("amount_total")]
        [Description("AmountTotal")]
        public decimal? AmountTotal { get; set; }

        /// <summary>
        /// CurrencyRate
        /// Float
        /// The rate of the currency to the currency of rate 1 applicable at the date of the order
        /// <summary>
        [JsonProperty("currency_rate")]
        [Description("CurrencyRate")]
        public double? CurrencyRate { get; set; }

        /// <summary>
        /// PaymentTermId
        /// Many2one
        /// account.payment.term
        /// <summary>
        [JsonProperty("payment_term_id")]
        [Description("PaymentTermId")]
        public long? PaymentTermId { get; set; }

        /// <summary>
        /// FiscalPositionId
        /// Many2one
        /// Fiscal positions are used to adapt taxes and accounts for particular customers or sales orders/invoices.The default value comes from the customer.
        /// account.fiscal.position
        /// <summary>
        [JsonProperty("fiscal_position_id")]
        [Description("FiscalPositionId")]
        public long? FiscalPositionId { get; set; }

        /// <summary>
        /// CompanyId
        /// Many2one
        /// required
        /// res.company
        /// <summary>
        [JsonProperty("company_id")]
        [Description("CompanyId")]
        public long CompanyId { get; set; }

        /// <summary>
        /// TeamId
        /// Many2one
        /// crm.team
        /// <summary>
        [JsonProperty("team_id")]
        [Description("TeamId")]
        public long? TeamId { get; set; }

        /// <summary>
        /// Signature
        /// Binary
        /// Signature received through the portal.
        /// <summary>
        [JsonProperty("signature")]
        [Description("Signature")]
        public string Signature { get; set; }

        /// <summary>
        /// SignedBy
        /// Char
        /// Name of the person that signed the SO.
        /// <summary>
        [JsonProperty("signed_by")]
        [Description("SignedBy")]
        public string SignedBy { get; set; }

        /// <summary>
        /// SignedOn
        /// Datetime
        /// Date of the signature.
        /// <summary>
        [JsonProperty("signed_on")]
        [Description("SignedOn")]
        public DateTime? SignedOn { get; set; }

        /// <summary>
        /// CommitmentDate
        /// Datetime
        /// This is the delivery date promised to the customer. If set, the delivery order will be scheduled based on this date rather than product lead times.
        /// <summary>
        [JsonProperty("commitment_date")]
        [Description("CommitmentDate")]
        public DateTime? CommitmentDate { get; set; }

        /// <summary>
        /// AmountUndiscounted
        /// Float
        /// <summary>
        [JsonProperty("amount_undiscounted")]
        [Description("AmountUndiscounted")]
        public double? AmountUndiscounted { get; set; }

        /// <summary>
        /// TypeName
        /// Char
        /// <summary>
        [JsonProperty("type_name")]
        [Description("TypeName")]
        public string TypeName { get; set; }

        /// <summary>
        /// TransactionIds
        /// Many2many
        /// payment.transaction
        /// <summary>
        [JsonProperty("transaction_ids")]
        [Description("TransactionIds")]
        public long[] TransactionIds { get; set; }

        /// <summary>
        /// AuthorizedTransactionIds
        /// Many2many
        /// payment.transaction
        /// <summary>
        [JsonProperty("authorized_transaction_ids")]
        [Description("AuthorizedTransactionIds")]
        public long[] AuthorizedTransactionIds { get; set; }

        /// <summary>
        /// ShowUpdatePricelist
        /// Boolean
        /// Technical Field, True if the pricelist was changed;
        ///    this will then display a recomputation button
        /// <summary>
        [JsonProperty("show_update_pricelist")]
        [Description("ShowUpdatePricelist")]
        public bool? ShowUpdatePricelist { get; set; }

        /// <summary>
        /// TagIds
        /// Many2many
        /// crm.tag
        /// <summary>
        [JsonProperty("tag_ids")]
        [Description("TagIds")]
        public long[] TagIds { get; set; }

        /// <summary>
        /// AppliedCouponIds
        /// One2many
        /// coupon.coupon
        /// sales_order_id
        /// <summary>
        [JsonProperty("applied_coupon_ids")]
        [Description("AppliedCouponIds")]
        public long[] AppliedCouponIds { get; set; }

        /// <summary>
        /// GeneratedCouponIds
        /// One2many
        /// coupon.coupon
        /// order_id
        /// <summary>
        [JsonProperty("generated_coupon_ids")]
        [Description("GeneratedCouponIds")]
        public long[] GeneratedCouponIds { get; set; }

        /// <summary>
        /// RewardAmount
        /// Float
        /// <summary>
        [JsonProperty("reward_amount")]
        [Description("RewardAmount")]
        public double? RewardAmount { get; set; }

        /// <summary>
        /// NoCodePromoProgramIds
        /// Many2many
        /// coupon.program
        /// <summary>
        [JsonProperty("no_code_promo_program_ids")]
        [Description("NoCodePromoProgramIds")]
        public long[] NoCodePromoProgramIds { get; set; }

        /// <summary>
        /// CodePromoProgramId
        /// Many2one
        /// coupon.program
        /// <summary>
        [JsonProperty("code_promo_program_id")]
        [Description("CodePromoProgramId")]
        public long? CodePromoProgramId { get; set; }

        /// <summary>
        /// PromoCode
        /// Char
        /// Applied program code
        /// <summary>
        [JsonProperty("promo_code")]
        [Description("PromoCode")]
        public string PromoCode { get; set; }

        /// <summary>
        /// SaleOrderTemplateId
        /// Many2one
        /// sale.order.template
        /// <summary>
        [JsonProperty("sale_order_template_id")]
        [Description("SaleOrderTemplateId")]
        public long? SaleOrderTemplateId { get; set; }

        /// <summary>
        /// SaleOrderOptionIds
        /// One2many
        /// sale.order.option
        /// order_id
        /// <summary>
        [JsonProperty("sale_order_option_ids")]
        [Description("SaleOrderOptionIds")]
        public long[] SaleOrderOptionIds { get; set; }

        /// <summary>
        /// PurchaseOrderCount
        /// Integer
        /// <summary>
        [JsonProperty("purchase_order_count")]
        [Description("PurchaseOrderCount")]
        public int? PurchaseOrderCount { get; set; }

        /// <summary>
        /// Incoterm
        /// Many2one
        /// International Commercial Terms are a series of predefined commercial terms used in international transactions.
        /// account.incoterms
        /// <summary>
        [JsonProperty("incoterm")]
        [Description("Incoterm")]
        public long? Incoterm { get; set; }

        /// <summary>
        /// PickingPolicy
        /// Selection
        /// If you deliver all products at once, the delivery order will be scheduled based on the greatest product lead time. Otherwise, it will be based on the shortest.
        /// required
        /// <summary>
        [JsonProperty("picking_policy")]
        [Description("PickingPolicy")]
        public ShippingPolicySaleOrderOdooEnum PickingPolicy { get; set; }

        /// <summary>
        /// WarehouseId
        /// Many2one
        /// required
        /// stock.warehouse
        /// <summary>
        [JsonProperty("warehouse_id")]
        [Description("WarehouseId")]
        public long WarehouseId { get; set; }

        /// <summary>
        /// PickingIds
        /// One2many
        /// stock.picking
        /// sale_id
        /// <summary>
        [JsonProperty("picking_ids")]
        [Description("PickingIds")]
        public long[] PickingIds { get; set; }

        /// <summary>
        /// DeliveryCount
        /// Integer
        /// <summary>
        [JsonProperty("delivery_count")]
        [Description("DeliveryCount")]
        public int? DeliveryCount { get; set; }

        /// <summary>
        /// ProcurementGroupId
        /// Many2one
        /// procurement.group
        /// <summary>
        [JsonProperty("procurement_group_id")]
        [Description("ProcurementGroupId")]
        public long? ProcurementGroupId { get; set; }

        /// <summary>
        /// EffectiveDate
        /// Date
        /// Completion date of the first delivery order.
        /// <summary>
        [JsonProperty("effective_date")]
        [Description("EffectiveDate")]
        public DateTime? EffectiveDate { get; set; }

        /// <summary>
        /// ExpectedDate
        /// Datetime
        /// Delivery date you can promise to the customer, computed from the minimum lead time of the order lines in case of Service products. In case of shipping, the shipping policy of the order will be taken into account to either use the minimum or maximum lead time of the order lines.
        /// <summary>
        [JsonProperty("expected_date")]
        [Description("ExpectedDate")]
        public DateTime? ExpectedDate { get; set; }

        /// <summary>
        /// JsonPopover
        /// Char
        /// <summary>
        [JsonProperty("json_popover")]
        [Description("JsonPopover")]
        public string JsonPopover { get; set; }

        /// <summary>
        /// ShowJsonPopover
        /// Boolean
        /// <summary>
        [JsonProperty("show_json_popover")]
        [Description("ShowJsonPopover")]
        public bool? ShowJsonPopover { get; set; }

        /// <summary>
        /// CarrierId
        /// Many2one
        /// Fill this field if you plan to invoice the shipping based on picking.
        /// delivery.carrier
        /// <summary>
        [JsonProperty("carrier_id")]
        [Description("CarrierId")]
        public long? CarrierId { get; set; }

        /// <summary>
        /// DeliveryMessage
        /// Char
        /// <summary>
        [JsonProperty("delivery_message")]
        [Description("DeliveryMessage")]
        public string DeliveryMessage { get; set; }

        /// <summary>
        /// DeliveryRatingSuccess
        /// Boolean
        /// <summary>
        [JsonProperty("delivery_rating_success")]
        [Description("DeliveryRatingSuccess")]
        public bool? DeliveryRatingSuccess { get; set; }

        /// <summary>
        /// DeliverySet
        /// Boolean
        /// <summary>
        [JsonProperty("delivery_set")]
        [Description("DeliverySet")]
        public bool? DeliverySet { get; set; }

        /// <summary>
        /// RecomputeDeliveryPrice
        /// Boolean
        /// <summary>
        [JsonProperty("recompute_delivery_price")]
        [Description("RecomputeDeliveryPrice")]
        public bool? RecomputeDeliveryPrice { get; set; }

        /// <summary>
        /// IsAllService
        /// Boolean
        /// <summary>
        [JsonProperty("is_all_service")]
        [Description("IsAllService")]
        public bool? IsAllService { get; set; }

        /// <summary>
        /// AttendeeCount
        /// Integer
        /// <summary>
        [JsonProperty("attendee_count")]
        [Description("AttendeeCount")]
        public int? AttendeeCount { get; set; }

        /// <summary>
        /// OpportunityId
        /// Many2one
        /// crm.lead
        /// <summary>
        [JsonProperty("opportunity_id")]
        [Description("OpportunityId")]
        public long? OpportunityId { get; set; }

        /// <summary>
        /// ExpenseIds
        /// One2many
        /// hr.expense
        /// sale_order_id
        /// <summary>
        [JsonProperty("expense_ids")]
        [Description("ExpenseIds")]
        public long[] ExpenseIds { get; set; }

        /// <summary>
        /// ExpenseCount
        /// Integer
        /// <summary>
        [JsonProperty("expense_count")]
        [Description("ExpenseCount")]
        public int? ExpenseCount { get; set; }

        /// <summary>
        /// Margin
        /// Monetary
        /// <summary>
        [JsonProperty("margin")]
        [Description("Margin")]
        public decimal? Margin { get; set; }

        /// <summary>
        /// MarginPercent
        /// Float
        /// <summary>
        [JsonProperty("margin_percent")]
        [Description("MarginPercent")]
        public double? MarginPercent { get; set; }

        /// <summary>
        /// MrpProductionCount
        /// Integer
        /// <summary>
        [JsonProperty("mrp_production_count")]
        [Description("MrpProductionCount")]
        public int? MrpProductionCount { get; set; }

        /// <summary>
        /// ReportGrids
        /// Boolean
        /// If set, the matrix of the products configurable by matrix will be shown on the report of the order.
        /// <summary>
        [JsonProperty("report_grids")]
        [Description("ReportGrids")]
        public bool? ReportGrids { get; set; }

        /// <summary>
        /// GridProductTmplId
        /// Many2one
        /// Technical field for product_matrix functionalities.
        /// product.template
        /// <summary>
        [JsonProperty("grid_product_tmpl_id")]
        [Description("GridProductTmplId")]
        public long? GridProductTmplId { get; set; }

        /// <summary>
        /// GridUpdate
        /// Boolean
        /// Whether the grid field contains a new matrix to apply or not.
        /// <summary>
        [JsonProperty("grid_update")]
        [Description("GridUpdate")]
        public bool? GridUpdate { get; set; }

        /// <summary>
        /// Grid
        /// Char
        /// Technical local storage of grid. 
        ///     If grid_update, will be loaded on the SO.
        ///     If not, represents the matrix to open.
        /// <summary>
        [JsonProperty("grid")]
        [Description("Grid")]
        public string Grid { get; set; }

        /// <summary>
        /// TasksIds
        /// Many2many
        /// project.task
        /// <summary>
        [JsonProperty("tasks_ids")]
        [Description("TasksIds")]
        public long[] TasksIds { get; set; }

        /// <summary>
        /// TasksCount
        /// Integer
        /// <summary>
        [JsonProperty("tasks_count")]
        [Description("TasksCount")]
        public int? TasksCount { get; set; }

        /// <summary>
        /// VisibleProject
        /// Boolean
        /// <summary>
        [JsonProperty("visible_project")]
        [Description("VisibleProject")]
        public bool? VisibleProject { get; set; }

        /// <summary>
        /// ProjectIds
        /// Many2many
        /// Projects used in this sales order.
        /// project.project
        /// <summary>
        [JsonProperty("project_ids")]
        [Description("ProjectIds")]
        public long[] ProjectIds { get; set; }

        /// <summary>
        /// TimesheetIds
        /// Many2many
        /// account.analytic.line
        /// <summary>
        [JsonProperty("timesheet_ids")]
        [Description("TimesheetIds")]
        public long[] TimesheetIds { get; set; }

        /// <summary>
        /// TimesheetCount
        /// Float
        /// <summary>
        [JsonProperty("timesheet_count")]
        [Description("TimesheetCount")]
        public double? TimesheetCount { get; set; }

        /// <summary>
        /// ProjectId
        /// Many2one
        /// Select a non billable project on which tasks can be created.
        /// project.project
        /// <summary>
        [JsonProperty("project_id")]
        [Description("ProjectId")]
        public long? ProjectId { get; set; }

        /// <summary>
        /// TimesheetEncodeUomId
        /// Many2one
        /// This will set the unit of measure used to encode timesheet. This will simply provide tools
        ///     and widgets to help the encoding.All reporting will still be expressed in hours (default value).
        /// uom.uom
        /// <summary>
        [JsonProperty("timesheet_encode_uom_id")]
        [Description("TimesheetEncodeUomId")]
        public long? TimesheetEncodeUomId { get; set; }

        /// <summary>
        /// TimesheetTotalDuration
        /// Integer
        /// Total recorded duration, expressed in the encoding UoM, and rounded to the unit
        /// <summary>
        [JsonProperty("timesheet_total_duration")]
        [Description("TimesheetTotalDuration")]
        public int? TimesheetTotalDuration { get; set; }

        /// <summary>
        /// CampaignId
        /// Many2one
        /// This is a name that helps you keep track of your different campaign efforts, e.g. Fall_Drive, Christmas_Special
        /// utm.campaign
        /// <summary>
        [JsonProperty("campaign_id")]
        [Description("CampaignId")]
        public long? CampaignId { get; set; }

        /// <summary>
        /// SourceId
        /// Many2one
        /// This is the source of the link, e.g. Search Engine, another domain, or name of email list
        /// utm.source
        /// <summary>
        [JsonProperty("source_id")]
        [Description("SourceId")]
        public long? SourceId { get; set; }

        /// <summary>
        /// MediumId
        /// Many2one
        /// This is the method of delivery, e.g. Postcard, Email, or Banner Ad
        /// utm.medium
        /// <summary>
        [JsonProperty("medium_id")]
        [Description("MediumId")]
        public long? MediumId { get; set; }

        /// <summary>
        /// ActivityIds
        /// One2many
        /// mail.activity
        /// res_id
        /// <summary>
        [JsonProperty("activity_ids")]
        [Description("ActivityIds")]
        public long[] ActivityIds { get; set; }

        /// <summary>
        /// ActivityState
        /// Selection
        /// Status based on activities
        ///     Overdue: Due date is already passed
        ///     Today: Activity date is today
        ///     Planned: Future activities.
       /// <summary>
       [JsonProperty("activity_state")]
       [Description("ActivityState")]
       public ActivityStateSaleOrderOdooEnum? ActivityState { get; set; }

        /// <summary>
        /// ActivityUserId
        /// Many2one
        /// res.users
        /// <summary>
        [JsonProperty("activity_user_id")]
        [Description("ActivityUserId")]
        public long? ActivityUserId { get; set; }

        /// <summary>
        /// ActivityTypeId
        /// Many2one
        /// mail.activity.type
        /// <summary>
        [JsonProperty("activity_type_id")]
        [Description("ActivityTypeId")]
        public long? ActivityTypeId { get; set; }

        /// <summary>
        /// ActivityTypeIcon
        /// Char
        /// Font awesome icon e.g. fa-tasks
        /// <summary>
        [JsonProperty("activity_type_icon")]
        [Description("ActivityTypeIcon")]
        public string ActivityTypeIcon { get; set; }

        /// <summary>
        /// ActivityDateDeadline
        /// Date
        /// <summary>
        [JsonProperty("activity_date_deadline")]
        [Description("ActivityDateDeadline")]
        public DateTime? ActivityDateDeadline { get; set; }

        /// <summary>
        /// MyActivityDateDeadline
        /// Date
        /// <summary>
        [JsonProperty("my_activity_date_deadline")]
        [Description("MyActivityDateDeadline")]
        public DateTime? MyActivityDateDeadline { get; set; }

        /// <summary>
        /// ActivitySummary
        /// Char
        /// <summary>
        [JsonProperty("activity_summary")]
        [Description("ActivitySummary")]
        public string ActivitySummary { get; set; }

        /// <summary>
        /// ActivityExceptionDecoration
        /// Selection
        /// Type of the exception activity on record.
        /// <summary>
        [JsonProperty("activity_exception_decoration")]
        [Description("ActivityExceptionDecoration")]
        public ActivityExceptionDecorationSaleOrderOdooEnum? ActivityExceptionDecoration { get; set; }

        /// <summary>
        /// ActivityExceptionIcon
        /// Char
        /// Icon to indicate an exception activity.
        /// <summary>
        [JsonProperty("activity_exception_icon")]
        [Description("ActivityExceptionIcon")]
        public string ActivityExceptionIcon { get; set; }

        /// <summary>
        /// MessageIsFollower
        /// Boolean
        /// <summary>
        [JsonProperty("message_is_follower")]
        [Description("MessageIsFollower")]
        public bool? MessageIsFollower { get; set; }

        /// <summary>
        /// MessageFollowerIds
        /// One2many
        /// mail.followers
        /// res_id
        /// <summary>
        [JsonProperty("message_follower_ids")]
        [Description("MessageFollowerIds")]
        public long[] MessageFollowerIds { get; set; }

        /// <summary>
        /// MessagePartnerIds
        /// Many2many
        /// res.partner
        /// <summary>
        [JsonProperty("message_partner_ids")]
        [Description("MessagePartnerIds")]
        public long[] MessagePartnerIds { get; set; }

        /// <summary>
        /// MessageChannelIds
        /// Many2many
        /// mail.channel
        /// <summary>
        [JsonProperty("message_channel_ids")]
        [Description("MessageChannelIds")]
        public long[] MessageChannelIds { get; set; }

        /// <summary>
        /// MessageIds
        /// One2many
        /// mail.message
        /// res_id
        /// <summary>
        [JsonProperty("message_ids")]
        [Description("MessageIds")]
        public long[] MessageIds { get; set; }

        /// <summary>
        /// MessageUnread
        /// Boolean
        /// If checked, new messages require your attention.
        /// <summary>
        [JsonProperty("message_unread")]
        [Description("MessageUnread")]
        public bool? MessageUnread { get; set; }

        /// <summary>
        /// MessageUnreadCounter
        /// Integer
        /// Number of unread messages
        /// <summary>
        [JsonProperty("message_unread_counter")]
        [Description("MessageUnreadCounter")]
        public int? MessageUnreadCounter { get; set; }

        /// <summary>
        /// MessageNeedaction
        /// Boolean
        /// If checked, new messages require your attention.
        /// <summary>
        [JsonProperty("message_needaction")]
        [Description("MessageNeedaction")]
        public bool? MessageNeedaction { get; set; }

        /// <summary>
        /// MessageNeedactionCounter
        /// Integer
        /// Number of messages which requires an action
        /// <summary>
        [JsonProperty("message_needaction_counter")]
        [Description("MessageNeedactionCounter")]
        public int? MessageNeedactionCounter { get; set; }

        /// <summary>
        /// MessageHasError
        /// Boolean
        /// If checked, some messages have a delivery error.
        /// <summary>
        [JsonProperty("message_has_error")]
        [Description("MessageHasError")]
        public bool? MessageHasError { get; set; }

        /// <summary>
        /// MessageHasErrorCounter
        /// Integer
        /// Number of messages with delivery error
        /// <summary>
        [JsonProperty("message_has_error_counter")]
        [Description("MessageHasErrorCounter")]
        public int? MessageHasErrorCounter { get; set; }

        /// <summary>
        /// MessageAttachmentCount
        /// Integer
        /// <summary>
        [JsonProperty("message_attachment_count")]
        [Description("MessageAttachmentCount")]
        public int? MessageAttachmentCount { get; set; }

        /// <summary>
        /// MessageMainAttachmentId
        /// Many2one
        /// ir.attachment
        /// <summary>
        [JsonProperty("message_main_attachment_id")]
        [Description("MessageMainAttachmentId")]
        public long? MessageMainAttachmentId { get; set; }

        /// <summary>
        /// WebsiteMessageIds
        /// One2many
        /// Website communication history
        /// mail.message
        /// res_id
        /// <summary>
        [JsonProperty("website_message_ids")]
        [Description("WebsiteMessageIds")]
        public long[] WebsiteMessageIds { get; set; }

        /// <summary>
        /// MessageHasSmsError
        /// Boolean
        /// If checked, some messages have a delivery error.
        /// <summary>
        [JsonProperty("message_has_sms_error")]
        [Description("MessageHasSmsError")]
        public bool? MessageHasSmsError { get; set; }

        /// <summary>
        /// AccessUrl
        /// Char
        /// Customer Portal URL
        /// <summary>
        [JsonProperty("access_url")]
        [Description("AccessUrl")]
        public string AccessUrl { get; set; }

        /// <summary>
        /// AccessToken
        /// Char
        /// <summary>
        [JsonProperty("access_token")]
        [Description("AccessToken")]
        public string AccessToken { get; set; }

        /// <summary>
        /// AccessWarning
        /// Text
        /// <summary>
        [JsonProperty("access_warning")]
        [Description("AccessWarning")]
        public string AccessWarning { get; set; }

        /// <summary>
        /// Id
        /// Integer
        /// <summary>
        [JsonProperty("id")]
        [Description("Id")]
        public long Id { get; set; }

        /// <summary>
        /// DisplayName
        /// Char
        /// <summary>
        [JsonProperty("display_name")]
        [Description("DisplayName")]
        public string DisplayName { get; set; }

        /// <summary>
        /// CreateUid
        /// Many2one
        /// res.users
        /// <summary>
        [JsonProperty("create_uid")]
        [Description("CreateUid")]
        public long? CreateUid { get; set; }

        /// <summary>
        /// WriteUid
        /// Many2one
        /// res.users
        /// <summary>
        [JsonProperty("write_uid")]
        [Description("WriteUid")]
        public long? WriteUid { get; set; }

        /// <summary>
        /// WriteDate
        /// Datetime
        /// <summary>
        [JsonProperty("write_date")]
        [Description("WriteDate")]
        public DateTime? WriteDate { get; set; }

        /// <summary>
        /// LastUpdate
        /// Datetime
        /// <summary>
        [JsonProperty("__last_update")]
        [Description("LastUpdate")]
        public DateTime? LastUpdate { get; set; }
    }


    [JsonConverter(typeof(StringEnumConverter))]
    public enum StatusSaleOrderOdooEnum
    {
        [EnumMember(Value = "draft")]
        Quotation = 1,

        [EnumMember(Value = "sent")]
        QuotationSent = 2,

        [EnumMember(Value = "sale")]
        SalesOrder = 3,

        [EnumMember(Value = "done")]
        Locked = 4,

        [EnumMember(Value = "cancel")]
        Cancelled = 5,
    }


    [JsonConverter(typeof(StringEnumConverter))]
    public enum InvoiceStatusSaleOrderOdooEnum
    {
        [EnumMember(Value = "upselling")]
        UpsellingOpportunity = 1,

        [EnumMember(Value = "invoiced")]
        FullyInvoiced = 2,

        [EnumMember(Value = "to invoice")]
        ToInvoice = 3,

        [EnumMember(Value = "no")]
        NothingToInvoice = 4,
    }


    // If you deliver all products at once, the delivery order will be scheduled based on the greatest product lead time. Otherwise, it will be based on the shortest.
    [JsonConverter(typeof(StringEnumConverter))]
    public enum ShippingPolicySaleOrderOdooEnum
    {
        [EnumMember(Value = "direct")]
        AsSoonAsPossible = 1,

        [EnumMember(Value = "one")]
        WhenAllProductsAreReady = 2,
    }


    // Status based on activities
    // Overdue: Due date is already passed
    // Today: Activity date is today
    // Planned: Future activities.
    [JsonConverter(typeof(StringEnumConverter))]
    public enum ActivityStateSaleOrderOdooEnum
    {
        [EnumMember(Value = "overdue")]
        Overdue = 1,

        [EnumMember(Value = "today")]
        Today = 2,

        [EnumMember(Value = "planned")]
        Planned = 3,
    }


    // Type of the exception activity on record.
    [JsonConverter(typeof(StringEnumConverter))]
    public enum ActivityExceptionDecorationSaleOrderOdooEnum
    {
        [EnumMember(Value = "warning")]
        Alert = 1,

        [EnumMember(Value = "danger")]
        Error = 2,
    }

}
